package utils;

import java.awt.Component;
import java.awt.Color;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

/**
 * Trida slouzici pro zabarveni do seda radku v tabulce sought listu. U tech
 * ktere jsou unrated
 * 
 * @author dove
 * 
 */
public class MyTableCellRenderer extends DefaultTableCellRenderer {
	private static final long serialVersionUID = 1L;

	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {
		String s = table.getModel().getValueAt(row, 5).toString();
		this.setForeground(Color.BLACK);
		this.setValue(value);
		if (s.equalsIgnoreCase("rated")) {
			this.setBackground(Color.WHITE);
		} else {
			this.setBackground(Color.LIGHT_GRAY);
		}

		return this;
	}
}
